﻿package mortal.game.view.copy.defenseCopy.panel
{
    import com.mui.controls.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class DefenseCopySingleLvBtnCell extends GCellRenderer
    {
        protected var _btn:GLoadedButton;
        private var _dif:int;

        public function DefenseCopySingleLvBtnCell()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._btn = UIFactory.gLoadedButton(ImagesConst.DefenseCopySinDiff1_upSkin, 0, 0, 95, 34, this);
            this._btn.label = "";
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._btn = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            this._dif = param1.data as int;
            this.updateInfo();
            return;
        }// end function

        private function updateInfo() : void
        {
            if (this._btn)
            {
                this._btn.dispose();
            }
            this._btn = UIFactory.gLoadedButton(ImagesConst["DefenseCopySinDiff" + this._dif + "_upSkin"], 0, 0, 95, 34, this);
            this._btn.label = "";
            return;
        }// end function

        override public function set selected(param1:Boolean) : void
        {
            super.selected = param1;
            if (param1)
            {
                this._btn.filters = [FilterConst.guideTipsFilter];
            }
            else
            {
                this._btn.filters = null;
            }
            return;
        }// end function

    }
}
